package enterprise.manage.entity;

import javax.persistence.*;
import java.util.Calendar;

/**
 * Created by IntelliJ IDEA.
 * User: zhenmingyue
 * Date: 2012-11-20
 * Time: 22:02:22
 * desc: 用户收获地址信息表
 */
@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true, dynamicInsert = true)
@Table(schema = "mg", name = "user_addr_info")
public class UserAddr {
    private Long id;
    /**
     * 用户ID  userId
     */
    private User user;
    /**
     * 收货人姓名
     */
    private String name;
    /**
     * 国家
     */
    private String country;
    /**
     * 省市
     */
    private String province;
    /**
     * 县区
     */
    private String city;
    /**
     * 街道
     */
    private String street;
    /**
     * 邮编
     */
    private String postcode;
    /**
     * 手机号
     */
    private String mobile;
    /**
     * 固话号
     */
    private String telephone;
    /**
     * 创建时间
     */
    private Calendar createTime;
    /**
     * 是否启用
     */
    private Integer defaultUsing;
    /**
     * 是否删除
     */
    private Integer delFlag;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.LAZY)
    @JoinColumn(name = "userId")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Calendar getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Calendar createTime) {
        this.createTime = createTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getPostcode() {
        return postcode;
    }

    public void setPostcode(String postcode) {
        this.postcode = postcode;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }


    public Integer getDefaultUsing() {
        return defaultUsing;
    }

    public void setDefaultUsing(Integer defaultUsing) {
        this.defaultUsing = defaultUsing;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }
}
